﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LGE;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Stealth
{
    public class Cloud : EngineObject
    {
        Vector2 pos1;
        Vector2 pos2 { get { return new Vector2(pos1.X + sprite.Width, pos1.Y); } }

        public Cloud(Vector2 pos)
            : base(Engine.Load<Texture2D>("Images\\StartScreen\\cloud"))
        {
            pos1 = pos;
        }

        public override void Update(GameTime gameTime)
        {
            pos1.X += (float)gameTime.ElapsedGameTime.TotalMilliseconds / 30;
            if (pos2.X > 1300) { pos1.X -= sprite.Width; }
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(sprite, pos1, Color.White);
            spriteBatch.Draw(sprite, pos2, Color.White);
        }

    }
}
